<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .greenbox{
            width: 400px;
            height: 400px;
            background-color: green;
        }
        .redbox{
            width: 300px;
            height: 300px;
            background-color: red;
        }
        .bluebox{
            width: 200px;
            height: 200px;
            background-color: blue;
        }

    </style>
</head>

<body>
    <div id="app">
        <!-- <input type="text" @keydown.prevent="fnGreen"> -->
        <div class="greenbox" @click="fnGreen">
            <div class="redbox" @click.self.stop="fnRed">
                <div class="bluebox" @click="fnBlue"></div>
            </div>
        </div>

    </div>
</body>

</html>
<script src="./js/vue2.js"></script>
<script>
    // 

    let vm = new Vue({
        el: "#app",
        data: {

        },
        methods: {
          fnGreen(){
            console.log("爷爷被点了");
          },
          fnRed(){
            console.log("爸爸被点了");
          },
          fnBlue(){
            console.log("我被点了");
          }
        }
    });


</script>